import Vue from "vue";
import VueI18n from "vue-i18n";
import eleENlocal from "element-ui/lib/locale/lang/en.js"
import eleCNlocal from "element-ui/lib/locale/lang/zh-CN.js"
import local from "element-ui/lib/locale"
import enLocal from "./en"
import cnLocal from "./zn-CN.js"
import cnTW from "./zn-TW.js"


Vue.use(VueI18n)
const messages = {
    en: {
        ...enLocal,
        ...eleENlocal
    },
    cn: {
        ...cnLocal,
        ...eleENlocal
    },
    cnTW: {
        ...cnTW
    }

}
const i18n = new VueI18n({
    locale: localStorage.getItem("language") || "cn",
    messages
})
local.i18n((k, v) => i18n.t(k, v))
export default i18n